<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import ="java.io.PrintWriter"%>
<%@ page import ="java.util.*"%>
<%@ page import ="javax.servlet.*"%>
<%@ page import ="net.sf.json.*"%>
<%@page import="model.CTGDM"%>
<%@page import="dao.CTGDD"%>
<%
JSONArray jsonarray = new JSONArray();
	CTGDD dao = new CTGDD();
	ArrayList<CTGDM> ls = dao.getAll();
	for(int i=0;i<ls.size();i++){
		JSONObject obj = new JSONObject();
		obj.put("id",ls.get(i).getId_ctgd());
		obj.put("ten", ls.get(i).getTen_day_du());
		obj.put("so_tc", ls.get(i).getTs_tc());
		jsonarray.add(obj);
	}
	PrintWriter ou = response.getWriter();
	ou.println(jsonarray);
	ou.flush();
	ou.close();
%>